package algorithm;

public class leetcode_0069 {
    public int mySqrt(int x) {
        int max=46340;
        if(x>=46340*46340) return 46340;
        return pow(x,0,46340);
    }
    public int pow(int x,int left,int right){
        if(right==left+1) return left;
        int mid=(left+right)/2;
        if(mid*mid>x) return pow(x,0,mid);
        else return pow(x,mid,right);
    }
}
